package com.itheima.stock.config;

import com.itheima.stock.properties.IdWorkersProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author zby
 * @created 2024-06-24 23:03
 * @description
 */
@Configuration
public class IdWorkersConfiguration {

    @Bean
    public IdWorkers idWorkers(IdWorkersProperties properties){
        return new IdWorkers(properties.getMachineId(),properties.getDatacenterId());
    }


}
